/**
Copyright [2009] [Julian Gamble] 

Licensed under the Apache License, Version 2.0 (the "License"); 
you may not use this file except in compliance with the License. 
You may obtain a copy of the License at 

	http://www.apache.org/licenses/LICENSE-2.0 
	
Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
See the License for the specific language governing permissions and 
limitations under the License. 
 **/
package cruiseprojectlist.domain.coveragecomplexity;

public class CoverageComplexity {
	private double linerate;

	private double branchrate;

	private int linescovered;

	private int linesvalid;

	private int branchescovered;

	private int branchesvalid;

	private double ccn;

	private String version;

	private String timestamp;

	public CoverageComplexity() {
	}

	public CoverageComplexity(int linerate, int branchrate, int linescovered,
			int linesvalid, int branchescovered, int branchesvalid, int ccn,
			String version, String timestamp) {
		super();
		this.linerate = linerate;
		this.branchrate = branchrate;
		this.linescovered = linescovered;
		this.linesvalid = linesvalid;
		this.branchescovered = branchescovered;
		this.branchesvalid = branchesvalid;
		this.ccn = ccn;
		this.version = version;
		this.timestamp = timestamp;
	}

	public double getLinerate() {
		return linerate;
	}

	public void setLinerate(String linerate) {
		if (linerate != null)
			if (linerate.length() > 0)
				setLinerate(Double.valueOf(linerate));
	}

	public void setLinerate(double linerate) {
		this.linerate = linerate;
	}

	public double getBranchrate() {
		return branchrate;
	}

	public void setBranchrate(String branchrate) {
		if (branchrate != null)
			if (branchrate.length() > 0)

				setBranchrate(Double.valueOf(branchrate));
	}

	public void setBranchrate(double branchrate) {
		this.branchrate = branchrate;
	}

	public int getLinescovered() {
		return linescovered;
	}

	public void setLinescovered(String linescovered) {
		if (linescovered != null)
			if (linescovered.length() > 0)

				setLinescovered(Integer.valueOf(linescovered));
	}

	public void setLinescovered(int linescovered) {
		this.linescovered = linescovered;
	}

	public int getLinesvalid() {
		return linesvalid;
	}

	public void setLinesvalid(String linesvalid) {
		if (linesvalid != null)
			if (linesvalid.length() > 0)

				setLinesvalid(Integer.valueOf(linesvalid));
	}

	public void setLinesvalid(int linesvalid) {
		this.linesvalid = linesvalid;
	}

	public int getBranchescovered() {
		return branchescovered;
	}

	public void setBranchescovered(String branchescovered) {
		if (branchescovered != null)
			if (branchescovered.length() > 0)
				setBranchescovered(Integer.valueOf(branchescovered));
	}

	public void setBranchescovered(int branchescovered) {
		this.branchescovered = branchescovered;
	}

	public int getBranchesvalid() {
		return branchesvalid;
	}

	public void setBranchesvalid(String branchesvalid) {
		if (branchesvalid != null)
			if (branchesvalid.length() > 0)
				setBranchesvalid(Integer.valueOf(branchesvalid));
	}

	public void setBranchesvalid(int branchesvalid) {
		this.branchesvalid = branchesvalid;
	}

	public double getCcn() {
		return ccn;
	}

	public void setCcn(String ccn) {
		if (ccn != null)
			if (ccn.length() > 0)

				setCcn(Double.valueOf(ccn));
	}

	public void setCcn(double ccn) {
		this.ccn = ccn;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("Coverage Details - ");
		sb.append("Line Rate:" + getLinerate());
		sb.append(", ");
		sb.append("Branch Rate:" + getBranchrate());
		sb.append(", ");
		sb.append("Lines Covered:" + getLinescovered());
		sb.append(", ");
		sb.append("Lines Valid:" + getLinesvalid());
		sb.append(", ");
		sb.append("Branches Covered:" + getBranchescovered());
		sb.append(", ");
		sb.append("Branches Valid:" + getBranchesvalid());
		sb.append(", ");
		sb.append("Ccn:" + getCcn());
		sb.append(", ");
		sb.append("Version:" + getVersion());
		sb.append(", ");
		sb.append("Timestamp:" + getTimestamp());

		sb.append(".");

		return sb.toString();
	}
}